import { lazy, Suspense } from "react";
import "./Index.module.less";
// import KeepAlive from "react-activation";
const Index = lazy(() => import("../view/Index"));

// 定义路由对象的类型
interface Route {
  path: string;
  element: JSX.Element;
  title: string;
}

// 创建路由数组
const routes: Route[] = [
  {
    path: "/",
    element: (
      <Suspense fallback={<div className="routerContent">Loading...</div>}>
        <Index />
      </Suspense>
    ),
    title: "",
  },
  {
    path: "/index",
    element: (
      <Suspense fallback={<div>Loading...</div>}>
        <Index />
      </Suspense>
    ),
    title: "",
  },
  // {
  //   path: "/list",
  //   element: (
  //     <KeepAlive saveScrollPosition={"screen"} when={true}>
  //       <Suspense fallback={<div>Loading...</div>}>
  //         <List />
  //       </Suspense>
  //     </KeepAlive>
  //   ),
  //   title: "服务单位",
  // },
];

export default routes;
